//package com.jvxb.manage.configuration.websocket;
//
//import com.alibaba.fastjson.JSON;
//import com.jvxb.manage.livable.service.WorkOrderService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//
//import java.io.IOException;
//import java.util.Set;
//
///**
// * @author jvxb
// * @since 2021-05-24
// */
//@Component
//public class SendSocketMsgJob {
//
//    @Autowired
//    WorkOrderService workOrderService;
//
//    /**
//     * 每30s给在线用户发消息（测试用）
//     */
////    @Scheduled(cron = "*/30 * * * * *")
//    public void sendSocketMsg() {
//        try {
//            Set<String> onlineUserIds = WebSocketServer.webSocketMap.keySet();
//            for (String userId : onlineUserIds) {
//                WebSocketServer.sendInfo(JSON.toJSONString(workOrderService.getInformMsgMap(userId)), userId);
//            }
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//    }
//}
